Skip to content

fix(run): detect the host from the locked records when installing - #7476

Merged
Hofer-Julian merged 3 commits into
prefix-dev:mainfrom
lucascolley:fix/locked-install-host-scope
Nov 10, 2026
Merged

Hofer-Julian merged 3 commits into
prefix-dev:mainfrom
lucascolley:fix/locked-install-host-scope

Conversation

@lucascolley

@lucascolley lucascolley commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Description

Ref. #7458 @lorhi

Ping the maintainers you discussed this contribution with here: @Hofer-Julian


Summary: trying to again reduce unnecessary computation for host platform detection, this time specifically when installing an environment (that may be large, or part of a large solve group).

LLM description:

Since #7462, pixi run detects only the host of the environment it
installs, but that detection still covers the environment's whole solve
group. Detection queries repodata recursively for the group's
dependencies, so an environment sharing a solve group with a larger one
still peaked at about 200 MiB, against about 40 MiB in 0.82.0.

An install from the lock file doesn't need solve candidates, so it now
detects only the virtual packages its locked records require, plus those
its platforms declare. Rather than the group's dependencies, that reads
only the detector registrations of the group's channels, bringing the
solve-group case down to about 54 MiB. A channel without sharded
repodata publishes those in its full repodata.json, which is then
still downloaded.

A detection for a solve still sees every candidate's names, so each
environment keeps it apart from the locked one and prefers it once
detected. A solve later in the same process then isn't handed the
narrower result.

The locked detection is kept until the manifest changes, so a workspace
held across a change to pixi.lock alone, as a long-lived pixi_api
consumer might, can miss a name the new lock requires.

The remaining gap to 0.82.0 is loading the channels' shard index to read
their registrations, which seems necessary to use custom detectors.

Checklist:

  • I've discussed the proposed changes with a maintainer.
  • I understand the purpose of my changes and how they interact with the greater system.
  • User-facing changes are documented and prose in the documentation has been written/edited/reviewed by hand.

Since prefix-dev#7462, `pixi run` detects only the host of the environment it
installs, but that detection still covers the environment's whole solve
group. Detection queries repodata recursively for the group's
dependencies, so an environment sharing a solve group with a larger one
still peaked at about 200 MiB, against about 40 MiB in 0.82.0.

An install from the lock file doesn't need solve candidates, so it now
detects only the virtual packages its locked records require, plus those
its platforms declare. Rather than the group's dependencies, that reads
only the detector registrations of the group's channels, bringing the
solve-group case down to about 54 MiB. A channel without sharded
repodata publishes those in its full `repodata.json`, which is then
still downloaded.

A detection for a solve still sees every candidate's names, so each
environment keeps it apart from the locked one and prefers it once
detected. A solve later in the same process then isn't handed the
narrower result.

The locked detection is kept until the manifest changes, so a workspace
held across a change to `pixi.lock` alone, as a long-lived `pixi_api`
consumer might, can miss a name the new lock requires.

The remaining gap to 0.82.0 is loading the channels' shard index to read
their registrations, which seems necessary to use custom detectors.

Fixes prefix-dev#7458
@lucascolley
lucascolley force-pushed the fix/locked-install-host-scope branch from e55b49e to 0137f5c Compare November 5, 2026 09:53
Comment thread crates/pixi_core/src/workspace/mod.rs Resolved
@lucascolley
lucascolley marked this pull request as ready for review November 5, 2026 09:58
@lucascolley lucascolley added bug Something isn't working area:run labels Nov 5, 2026
Reuse detections by host scope and replace the locked snapshot when the scope changes. Keep full-solve detection preferred.

Verify lock replacement and reversion in one workspace, cache reuse, and solve-after-install behavior. Release tests and smoke checks pass; the memory improvement is preserved.
@Hofer-Julian
Hofer-Julian enabled auto-merge (squash) November 10, 2026 10:02
@Hofer-Julian
Hofer-Julian merged commit 2bab195 into prefix-dev:main Nov 10, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:run bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants